# 导包
from selenium import webdriver
from time import sleep

from selenium.webdriver.common.by import By

# 获取浏览器驱动对象
driver = webdriver.Chrome()

# 打开url
url = r"D:\python\python-selenium-learn\a03_元素和浏览器的操作方法\learn-files\注册A.html"
driver.get(url)

# 输入用户名 admin
driver.find_element(By.CSS_SELECTOR, "#userA").send_keys("admin")

# 输入 密码 123456
driver.find_element(By.CSS_SELECTOR, "#passwordA").send_keys("123456")

# 输入 电话 18611112222
driver.find_element(By.CSS_SELECTOR, ".telA").send_keys("18611112222")

# 输入 邮箱 123@qq.com
driver.find_element(By.CSS_SELECTOR, "#emailA").send_keys("123@qq.com")

# 暂停3秒
sleep(3)

# 修改电话号码 18622223333    -->清空操作
driver.find_element(By.CSS_SELECTOR, ".telA").clear()
driver.find_element(By.CSS_SELECTOR, ".telA").send_keys("18622223333")

# 暂停3秒
sleep(3)

# 点击注册按钮
driver.find_element(By.CSS_SELECTOR, "button").click()

# 暂停3秒
sleep(3)

# 关闭驱动对象
driver.quit()

